package com.源码分析;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import reactor.core.publisher.Mono;

public class ToFutureDemo {

	private Logger logger = LoggerFactory.getLogger(FromCompletionStage.class);

	@Test
	public void test() throws InterruptedException, ExecutionException {
		// 将此Mono转换为一个完整的Future，在onNext或onComplete上完成，在ononError上失败。
		CompletableFuture<String> f = Mono.just("value").toFuture();
		logger.info(f.get());
	}

}
